#ifndef __UI_H
#define __UI_H

#include "main.h"

/******** 图形名称定义 *******/
#define GRAPIC_TARGET_Y                  0x01 /* 准心十字线 竖线 */
#define GRAPIC_TARGET_X1                 0x02 /* 准心十字线 横线1 */
#define GRAPIC_TARGET_X2                 0x03 /* 准心十字线 横线2 */
#define GRAPIC_TARGET_X3                 0x04 /* 准心十字线 横线3 */
#define GRAPIC_TARGET_X4                 0x05 /* 准心十字线 横线4 */

#define GRAPIC_CAR_LEFT                  0x06 /* 车宽左边线 */
#define GRAPIC_CAR_RIGHT                 0x07 /* 车宽右边线 */

#define GRAPIC_CHARACTER_SUPERCAP        0x08 /* 超级电容电量 */
#define GRAPIC_CHARACTER_SUPERCAPLINE    0x09 /* 超级电容电量条*/

#define GRAPIC_CHARACTER_CHASSIS         0x10 /* 小陀螺字符 */
#define GRAPIC_CHARACTER_BotLevel        0x11 /* 小机器人等级 */

#define GRAPIC_CHARACTER_AIMBOT   			 0x12 /* 自瞄字符 */
#define GRAPIC_CHARACTER_SUPERCAP_STATE  0x13 /* 超级电容字符 */

#define GRAPIC_CHARACTER_FRICTION        0x14 /* 摩擦轮字符 */
#define GRAPIC_CHARACTER_FRICTIONF       0x15 /* 摩擦轮图画 */

#define GRAPIC_CHARACTER_DEPLOY          0x16 /* 部署模式字符*/


#define GRAPIC_Circle          						0x17 
#define GRAPIC_Rectangle       						0x18
#define GRAPIC_CircleArc_1     					  0x19
#define GRAPIC_CircleArc_2    					  0x20
#define GRAPIC_CHARACTER_Robotpos    	    0x21

typedef enum {
    red_bule = 0,
    yellow,       /*黄色*/
    green,        /*绿色*/
    orange,       /*橙色*/
    amaranth,     /*紫红色*/
    pink,         /*粉色*/
    cyan,         /*青色*/
    black,        /*黑色*/
    white,        /*白色*/
} ui_color;

class UI {
   public:
		 UI(void);
	  int     init(void);
		
    void Target(int operation_tpye, int x, int y);
    void Car_Width(int operation_tpye);
    void BotLevel(int operation_tpye, int level);
    void CapVoltage(int operation_tpye, float supercap_voltage);
    void ChassisFace(int operation_tpye, int16_t yaw,int16_t arc_length);
    void DeleteAllGraphic(void);
    void aimbot_state(int operation_type, uint8_t is_open);
    void friction_state(int operation_type, uint8_t is_open);
		void supercap_state(int operation_type, uint8_t is_open);
	 	void deploy_state(int operation_type, bool is_open);
	 	void AddGraphic_all();
	 
		void Circle(int operation_tpye, int x, int y,int r);
		void Rectangle(int operation_tpye, int start_x, int start_y,int end_x,int end_y);
//		void  AddGraphic_all(uint8_t renovate);
		//void friction_state(int operation_tpye, uint8_t is_launched);
   //void Stuck(int operation_tpye, uint8_t is_stuck);
	  void debug(void);

		void Robot_pos(int operation_tpye, int x, int y);

		uint8_t ctrl=0; //遥控器标志
};
extern UI ui;
#endif  // __UI_H
